@import "../../assets/less/variable";

.display {
  height: 120px;

  background-color: @body-background;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100%;

  margin-bottom: 20px;
  border-radius: 2px;
  box-shadow: @block-box-shadow;
  transform: translate3d(0, 0, 0);
  transition: all 200ms linear;
  transition: transform 200ms linear,
              box-shadow 200ms linear,
              background-size 500ms linear;
  cursor: pointer;

  &.editing {
    opacity: .3;
  }

  header {
    background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0) 100%);
    border-radius: 2px 2px 0 0;
  }

  .container {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;

    .central {
      flex: 1;
      height: 100%;
      width: 100%;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;

      &:hover {
        .icon,.text {
          color: @blue;
          cursor: pointer;
        }
      }

      .item {
        color: @light-text-color;

        &.icon {
          font-size: 28px;
        }

        &.text {
          font-size: 16px;
        }
      }
    }
  }

  &:hover {
    background-size: 110%;
    box-shadow: @block-active-box-shadow;
    transform: translate3d(0, -5px, 0);

    .pic {
      transform: translate(0, -5px);
    }
  }

  .title {
    padding: 12px 40px 0 12px;
    color: @white;
    font-size: 1.15em;
    font-weight: normal;

    .ellipsis;
  }

  .content {
    padding: 8px 12px 24px;
    color: @white;
    font-size: .85em;

    .ellipsis;
  }

  .displayActions {
    position: absolute;
    right: 8px;
    top: 8px;

    .delete, .copy, .edit {
      color: @white;
      margin-left: 8px;
      font-size: 15px;
      opacity: .5;
      transition: transform 200ms ease;

      &:hover {
        opacity: 1;
        transform: scale(1.1, 1.1);
      }
    }
  }
}

.preview {
  height: 100%;
  width: 100%;
  overflow: hidden;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  user-select: none;

  &::-webkit-scrollbar {
    display: none;
  }

  .board {
    position: relative;
  }

  &.edit {
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  .header {
    flex-shrink: 0;
    height: 40px;
    background-color: @light-bg;
    box-shadow: @header-box-shadow;
    z-index: @header-index;
    display: flex;
    flex-direction: row;
    align-items: center;
  }

  .body {
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: row;

    .main {
      background: url('../../assets/images/grid.png') repeat;
      flex: 1;
      display: flex;
      flex-direction: column;
      overflow: hidden;

      .bottom {
        height: 40px;
        background-color: @white;
        flex-shrink: 0;
        display: flex;
        flex-direction: row;
        justify-content: flex-end;

        .sliderWrapper {
          width: 240px;
          padding: 0 10px;
          flex-shrink: 0;
          display: flex;
          flex-direction: row;
          align-items: center;

          label {
            width: 40px;
          }

          .slider {
            flex: 1;
          }

          i {
            flex-shrink: 0;
            margin: 0 8px;
            color: @disabled-text-color;
            font-size: 18px;
            cursor: pointer;
          }
        }
      }
    }

    .sidebar {
      display: flex;
      flex-direction: row;
      background-color: @light-bg;
      box-shadow: @right-side-box-shadow;
      flex-shrink: 0;

      .collapse {
        width: 50px;
        border-right: 1px solid @border-color-base;

        .title {
          padding-top: 22px;
          text-align: center;
          label {
            font-size: 18px;
            text-orientation: upright;
            writing-mode: vertical-rl;
          }
        }
      }

      .left {
        width: 160px;
        display: flex;
        flex-direction: column;
        border-right: 1px solid @border-color-base;

        .commands {
          flex: none;
        }

        .layerList {
          flex: 1;
          overflow-y: auto;

          li {
            // margin-top: -1px;
            display: flex;
            align-items: center;
            padding: 4px 16px;
            border-bottom: 1px solid @border-color-base;
          }

          ul:last-child {
            margin-bottom: 8px;
          }

          i {
            font-size: 12px;
            &:hover {
              cursor: pointer;
            }
          }
          li span {
            display: inline-block;
            flex: 1;
            white-space: nowrap;
            text-overflow: ellipsis;
            overflow: hidden;
            padding-left: 8px;
          }
        }

        .footer {
          padding: 8px 16px
        }
      }

      .right {
        width: 320px;
        display: flex;
        flex-direction: column;

        :global(i.icon-palette) {
          font-size: 30px;
        }

        .items {
          flex: 1;
          overflow-y: auto;
        }

        .alignList {
          display: flex;
          flex-direction: column;
          margin-top: 16px;

          .category {
            flex: 1;
            display: flex;
            flex-direction: row;
            justify-content: center;
            margin-bottom: 8px;

            i + i {
              margin-left: 16px;
            }
          }
        }

        i:hover {
          cursor: pointer;
        }
      }
    }
  }

  .layer {
    display: flex;
    flex-direction: column;

    &.view {
      position: absolute;
      top: 0;
      left: 0;
      height: 100%;
      width: 100%;
      user-select: none;

      &:hover:after {
        content: ' ';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        display: block;
        background: rgba(0,192,222,.2);
        z-index: 999990;
      }

      .tools {
        display: none;
        position: absolute;
        right: 8px;
        z-index: 999998;

        i {
          color: #fff;
          font-size: 16px;
          line-height: 40px;
          display: inline-block;
          cursor: pointer;
          transition: transform 200ms ease;

          &:hover {
            transform: scale(1.1, 1.1);
          }
        }
      }

      &:hover .tools {
        display: inline-block;
      }
    }

    &.selected:after {
      content: ' ';
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      display: block;
      background: rgba(0,192,222,.3);
      z-index: 999990;
      border: 2px solid @border-color-base;
    }

    &.rect {
      background-color: @light-bg;
    }

    & video {
      flex: 1;
      z-index: 999991;
    }

    & > span:last-child {
      z-index: 999999;
    }
  }
}

.displayContainer {
  flex: 1;
}

.displayPanel {
  position: relative;
  background-color: #3F51B5;
  box-shadow: @block-active-box-shadow;
  transform-origin: 0 0;
  transition: all ease-in 200ms;

  .baseline {
    position: absolute;
    z-index: 999999;
  }
}

.formTitle {
  padding: 24px 16px 16px;
  border-bottom: 1px solid @border-color-base;
  color: @black;
  font-size: 18px;
  font-weight: normal;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;

  i {
    line-height: 27px;
    color: @light-text-color;

    &:hover {
      cursor: pointer;
    }
  }
}

.formBlockTitle {
  padding: 16px 16px 10px 0;
  font-size: 14px;
  font-weight: normal;
}

.formBlock {
  padding: 0 16px;
  border-bottom: 1px solid @border-color-base;
}

.formItemTitle {
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: normal;
}

.formItem {
  margin-bottom: 16px;

  &:last-child {
    margin-bottom: 24px;
  }

  label {
    font-size: 12px;
  }

  input {
    background-color: @light-bg;
  }

  .inputNumber {
    width: 100%;
  }
}

.upload {
  display: block;
  padding-bottom: 75%;
  border: 1px dashed @border-color-base;
  box-sizing: border-box;
  border-radius: 3px;
  cursor: pointer;

  i {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 36px;
    color: @light-text-color;
  }

  .img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    img {
      display: block;
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      max-width: 100%;
      max-height: 100%;
    }
  }

  i {
    display: none;
  }

  &:hover i {
    display: block;
  }
}

.commands {
  flex: 1;
  display: flex;
  flex-direction: row;
  border-bottom: 1px solid @border-color-base;

  .commandGroup {
    padding: 0 8px;
    display: flex;
    flex-direction: row;
    position: relative;

    &:before {
      width: 1px;
      height: 20px;
      background-color: @border-color-base;
      position: absolute;
      top: 6px;
      left: 0;
      content: '';
    }
  }

  .historyBack {
    padding: 0 16px;
    display: flex;
    flex-direction: row;
  }

  li {
    width: 36px;
    height: 32px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    &.disabled {
      cursor: default;

      i {
        color: @body-bg;
      }
    }

    &:not(.disabled):hover {
      background-color: darken(@light-bg, 10%);
    }

    i {
      font-size: 20px;
      color: @light-text-color;

      &.primary {
        color: @primary-color;
      }
    }
  }
}
